Optimal. Leaf size=55 \[ \frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{a} \cos (e+f x)}{\sqrt{b}}\right )}{\sqrt{a} f (a+b)}-\frac{\tanh ^{-1}(\cos (e+f x))}{f (a+b)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0705629, antiderivative size = 55, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {4133, 481, 206, 205} \[ \frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{a} \cos (e+f x)}{\sqrt{b}}\right )}{\sqrt{a} f (a+b)}-\frac{\tanh ^{-1}(\cos (e+f x))}{f (a+b)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4133
Rule 481
Rule 206
Rule 205
Rubi steps
\begin{align*} \int \frac{\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{x^2}{\left (1-x^2\right ) \left (b+a x^2\right )} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac{\operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\cos (e+f x)\right )}{(a+b) f}+\frac{b \operatorname{Subst}\left (\int \frac{1}{b+a x^2} \, dx,x,\cos (e+f x)\right )}{(a+b) f}\\ &=\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{a} \cos (e+f x)}{\sqrt{b}}\right )}{\sqrt{a} (a+b) f}-\frac{\tanh ^{-1}(\cos (e+f x))}{(a+b) f}\\ \end{align*}
Mathematica [C] time = 0.623957, size = 239, normalized size = 4.35 \[ \frac{\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sin (e) \tan \left (\frac{f x}{2}\right ) \left (-\sqrt{a}-i \sqrt{a+b} \sqrt{(\cos (e)-i \sin (e))^2}\right )+\cos (e) \left (\sqrt{a}-\sqrt{a+b} \sqrt{(\cos (e)-i \sin (e))^2} \tan \left (\frac{f x}{2}\right )\right )}{\sqrt{b}}\right )}{\sqrt{a}}+\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sin (e) \tan \left (\frac{f x}{2}\right ) \left (-\sqrt{a}+i \sqrt{a+b} \sqrt{(\cos (e)-i \sin (e))^2}\right )+\cos (e) \left (\sqrt{a}+\sqrt{a+b} \sqrt{(\cos (e)-i \sin (e))^2} \tan \left (\frac{f x}{2}\right )\right )}{\sqrt{b}}\right )}{\sqrt{a}}+\log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )-\log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )}{f (a+b)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.066, size = 76, normalized size = 1.4 \begin{align*} -{\frac{\ln \left ( 1+\cos \left ( fx+e \right ) \right ) }{f \left ( 2\,a+2\,b \right ) }}+{\frac{b}{f \left ( a+b \right ) }\arctan \left ({a\cos \left ( fx+e \right ){\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}+{\frac{\ln \left ( -1+\cos \left ( fx+e \right ) \right ) }{f \left ( 2\,a+2\,b \right ) }} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.564539, size = 410, normalized size = 7.45 \begin{align*} \left [\frac{\sqrt{-\frac{b}{a}} \log \left (-\frac{a \cos \left (f x + e\right )^{2} + 2 \, a \sqrt{-\frac{b}{a}} \cos \left (f x + e\right ) - b}{a \cos \left (f x + e\right )^{2} + b}\right ) - \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) + \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right )}{2 \,{\left (a + b\right )} f}, \frac{2 \, \sqrt{\frac{b}{a}} \arctan \left (\frac{a \sqrt{\frac{b}{a}} \cos \left (f x + e\right )}{b}\right ) - \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) + \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right )}{2 \,{\left (a + b\right )} f}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\csc{\left (e + f x \right )}}{a + b \sec ^{2}{\left (e + f x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.14841, size = 116, normalized size = 2.11 \begin{align*} -\frac{\frac{2 \, b \arctan \left (-\frac{a \cos \left (f x + e\right ) - b}{\sqrt{a b} \cos \left (f x + e\right ) + \sqrt{a b}}\right )}{\sqrt{a b}{\left (a + b\right )}} - \frac{\log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}{a + b}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]